package xyz.poke.business.tool.utils;

import xyz.poke.business.tool.common.Response;

import java.io.Serializable;

/**
 * @author 迫壳
 * @date 2024/3/2 14:22
 */
public class ResponseUtils {

    public static <T> Response<T> ok(T data) {
        return new Response<>(200, null , data);
    }

    public static <T> Response<T> fail() {
        return new Response<>(500, "服务器繁忙" , null);
    }

    public static <T> Response<T> fail(String errorMsg , int errorCode) {
        return new Response<>(errorCode, errorMsg , null);
    }
}
